package com.haojie.server;

import com.haojie.service.BlogService;
import com.haojie.service.UserService;

public class TestServer {
    public static void main(String[] args) {

        UserService userService = new UserServiceImpl();
        BlogService blogService = new BlogServiceImpl();
//        Map<String, Object> serviceProvide = new HashMap<String, Object>();

//        serviceProvide.put("com.haojie.service.UerService", userService);
//        serviceProvide.put("com.haojie.service.BlogService", blogService);
        ServiceProvider serviceProvider = new ServiceProvider();
        serviceProvider.registerService(userService);
        serviceProvider.registerService(blogService);

//        RPCServer rpcServer = new ThreadPoolRPCServer(serviceProvider);
//        rpcServer.start(8899);
        NettyRPCServer nettyRPCServer = new NettyRPCServer(serviceProvider);
        nettyRPCServer.start(8899);

    }
}
